import { get } from '@/server/http'
import request from '@/server/request'  // 直接引入 instance


// 请求tabs数据
export const getTabsAPI = () => {
  return get('getcate')
}
// 请求banners
export const getbannerAPI = () => {
  return get('getbanner')
}
// 请求功能区
export const gethortgoodsAPI = () => {
  return get('gethortgoods')
}


// 商品列表页
// getgoodlist
export const getGoodListAPI = (params) => {
  return get('getgoodlist', params)
}
// 商品详情页
export const getGoodDetailAPI = (params) => {
  return get('getgoodsinfo', params)
}
// 加入购物车 - 特殊处理 表单数据请求

export const addCartAPI = (params) => {
  return request({
    method: 'post',
    url: 'cartadd',
    data: params,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

